package com.sdonkey.score.service.impl;

import com.sdonkey.score.dao.IUserRegisterDao;
import com.sdonkey.score.dto.register.RegisterPageAdInfo;
import com.sdonkey.score.dto.register.RegisterPageBasicInfo;
import com.sdonkey.score.dto.register.RegisterPageDetailedInfo;
import com.sdonkey.score.dto.register.RegisterPageLoginInfo;
import com.sdonkey.score.service.IUserRegisterService;
import com.sdonkey.score.util.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 用户注册服务接口实现类
 *
 * @author ZhaoShihao
 * @version 1.0
 */
@Service
@Transactional
public class UserRegisterServiceImpl implements IUserRegisterService {
    @Autowired
    private IUserRegisterDao registerDao;

    @Override
    public void insertUser(RegisterPageLoginInfo loginInfo) {
        loginInfo.setPassword(MD5.encode(loginInfo.getPassword()));
        registerDao.insertUser(loginInfo);
    }

    @Override
    public void updateUserDetailedInfo(RegisterPageDetailedInfo detailedInfo) {
        registerDao.updateUserDetailedInfo(detailedInfo);
    }

}
